//~--- JDK imports ------------------------------------------------------------

import java.math.*;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Locale.setDefault(Locale.US);

        Scanner in    = new Scanner(System.in);
        int     len   = in.nextInt();
        int     N     = in.nextInt();
        double  p     = in.nextDouble();
        Random  rnd   = new Random();
        double  A[]   = new double[N + 1];
        int     bin[] = new int[len];

        for (int i = 0; i < len; ++i) {
            for (int j = 0; j <= N; ++j) {
                A[j] = rnd.nextDouble();
            }

            for (int j = 0; j <= N; ++j) {
                if (A[j] < p) {
                    ++bin[i];
                }
            }
        }

        double e = 0;

        for (int i = 0; i < len; ++i) {
            e += bin[i];
        }

        e /= len;

        double d = 0;

        for (int i = 0; i < len; ++i) {
            d += Math.pow(bin[i] - e, 2.0);
        }

        d /= (len - 1);
        System.out.println(e + "\t" + N * p);
        System.out.println(d + "\t" + N * p * (1 - p));
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
